package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.junsi.bean.Rank;
import com.junsi.mapper.RankMapper;
import com.junsi.service.RankService;

@Service
public class RankServiceImpl  implements RankService{
	@Autowired
	private RankMapper rankMapper;

	@Override
	public List<Rank> listAll() {
		List<Rank> list = rankMapper.listAll();
		return list;
	}

	@Override
	public Rank findById(Integer id) {
		Rank rank=rankMapper.findById(id);
		return rank;
	}

	@Override
	public boolean insert(Rank o){
		int result = rankMapper.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean update(Rank o)  {
		int result = rankMapper.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean delete(Integer id) {
		int result = rankMapper.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

}
